var __extends =
    (this && this.__extends) ||
    (function () {
      var e = function (t, i) {
        return (e =
          Object.setPrototypeOf ||
          ({ __proto__: [] } instanceof Array &&
            function (e, t) {
              e.__proto__ = t;
            }) ||
          function (e, t) {
            for (var i in t)
              Object.prototype.hasOwnProperty.call(t, i) && (e[i] = t[i]);
          })(t, i);
      };
      return function (t, i) {
        function n() {
          this.constructor = t;
        }
        if ("function" != typeof i && null !== i)
          throw new TypeError(
            "Class extends value " + String(i) + " is not a constructor or null"
          );
        e(t, i),
          (t.prototype =
            null === i
              ? Object.create(i)
              : ((n.prototype = i.prototype), new n()));
      };
    })(),
  GuessFigureView = (function (e) {
    function t() {
      var t = e.call(this) || this;
      return (
        (t.tab_figure.selectHandler = new Laya.Handler(
          t,
          t.onSelectResultView
        )),
        t.btn_figerOK.on(Laya.Event.CLICK, t, t.onAcceptFingureActionFn),
        t.btn_figureClose.on(Laya.Event.CLICK, t, t.close),
        t
      );
    }
    return (
      __extends(t, e),
      (t.open = function (e, i) {
        null == this.guess_figure &&
          ((this.guess_figure = new t()), (this.guess_figure.zOrder = 1e3)),
          this.guess_figure.popup(!0),
          (this.guess_figure.figure_id = e),
          (this.guess_figure.figure_value = ""),
          (this.guess_figure.lbl_figureTitle.text = i),
          (this.guess_figure.tab_figure.selectedIndex = -1);
      }),
      (t.prototype.onSelectResultView = function (e) {
        0 == e
          ? (this.figure_value = "1")
          : 1 == e
          ? (this.figure_value = "2")
          : 2 == e && (this.figure_value = "3");
      }),
      (t.prototype.onAcceptFingureActionFn = function () {
        parseInt(this.figure_value) <= 0
          ? ToastView.toastView("请选择出拳")
          : (WebSocketService.send({
              c: 2111,
              d: { value: this.figure_value, id: this.figure_id },
            }),
            this.close());
      }),
      (t.close = function () {
        this.guess_figure && this.guess_figure.close();
      }),
      t
    );
  })(ui.SquareController.GuessFingerViewUI);
